package com.luck.easyfoodbatch.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.luck.easyfoodbatch.R;
import com.luck.easyfoodbatch.entity.News;
import com.luck.easyrecyclerview.adapter.BaseViewHolder;
import com.luck.easyrecyclerview.adapter.RecyclerArrayAdapter;

/**
 * author：luck
 * project：LoveCare
 * package：com.tongyu.luck.lovecare.adapter
 * email：893855882@qq.com
 * data：16/8/12
 */
public class FindAdapter extends RecyclerArrayAdapter<News> {
    private Context mContext;

    public FindAdapter(Context context) {
        super(context);
        this.mContext = context;
    }

    @Override
    public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {

        return new CouponViewHolder(parent);
    }

    public class CouponViewHolder extends BaseViewHolder<News> {
        ImageView iv_icon;
        TextView tv_title, tv_desc;

        public CouponViewHolder(ViewGroup parent) {
            super(parent, R.layout.find_item);
            iv_icon = $(R.id.iv_icon);
            tv_title = $(R.id.tv_title);
            tv_desc = $(R.id.tv_desc);
        }

        @Override
        public void setData(final News bean, int position) {
            iv_icon.setImageResource(bean.getResources());
            tv_title.setText(bean.getName());
            //tv_desc.setText("全面深化改革，是决定当代中国命运的关键一招。");
        }
    }
}
